#ifndef HOLDEM_STATE
#define HOLDEM_STATE
//TODO: copy constructor
#include "sfGlobals.h"
#include <string.h>
#include "iPlayerInfo.h"
#include "ActionPl.h";
#include <vector>;

using namespace std;

class iPlayerInfo;

enum BetRound
{
	BR_PREFLOP=1,
	BR_FLOP=2,
	BR_TERN=3,
	BR_RIVER=4
};

class HoldemState
{
public:
	HoldemState();
	HoldemState(const HoldemState& hs);
	HoldemState & operator = (const HoldemState & other);
//new
	string table_title;	//table title
	long int handNumber;
	int pot;	//total in each pot
	int BBlind;
	int SBlind;
	int posDiller;
	//Betting Round
	BetRound round;
	//common cards
	unsigned char  cards[5];

	int posBB;
	int posSB;
	std::vector<ActionPlExt*> actionList;
	std::vector<ActionPlExt*>::iterator actionPointer;
	int plCount;	
	
	iPlayerInfo player[9];

	int	 plSeated;
	int	 plPlaying;

	int  maxBetSize;
	int  betMultiplier;
	int  curPlayer;
public:
	//void update_state();	
	void update_state_new();	
	void ShowTdata();
	bool GetNextActivePlayer(int& nextPose);
	//int GetWRTypeNumber();
	//int GetWRPoseNumber();
private:	
	//void CalculateActionType();
	void CalculateBBPose();//may be some errors with BB raising	
private://new
	void UpdateCommonFields();
	void UpdatePlayerFields();
	void CreatePreflopActions();
	void UpdatePreflopActions();
private:
	bool newActionRound;

};

#endif